package java_io;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import static java.lang.System.out;

public class BufferedReadLinesFile {

	public static void main(String[] args) {
		final String dir = System.getProperty("user.dir");
		Charset charset = Charset.forName("US-ASCII");
		Path path = Paths.get(dir + "\\bin\\javacore\\io\\contacts.csv");
		
		try (BufferedReader reader = Files.newBufferedReader(path, charset)) {
		    String line = null;
		    while ((line = reader.readLine()) != null) {
		        System.out.println(line);
		    }
		} catch (IOException x) {
		    System.err.format("IOException: %s%n", x);
		}

	}

}
